package com.hmis.domain.entityProperty;

import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleLongProperty;
import javafx.beans.property.SimpleStringProperty;

import java.text.SimpleDateFormat;
import java.util.Date;


public class PatientProperty {

    private SimpleLongProperty patientId;
    private SimpleStringProperty patientName;
    private SimpleStringProperty sex;
    private SimpleLongProperty wardNo;
    private SimpleLongProperty bedNo;
    private SimpleStringProperty deptName;
    private SimpleLongProperty theBedNo;
    private SimpleLongProperty doctorId;
    private SimpleStringProperty doctorName;
    private SimpleStringProperty illness;
    private SimpleStringProperty diagnose;
    private SimpleStringProperty status;
    private SimpleStringProperty createTime;

    private SimpleStringProperty modifyTime;
    private SimpleIntegerProperty isDelete;

    public PatientProperty(Long patientId, String patientName, Long wardNo, Long bedNo) {
        this.patientId = new SimpleLongProperty(patientId);
        this.patientName = new SimpleStringProperty(patientName);
        this.wardNo = new SimpleLongProperty(wardNo);
        this.bedNo = new SimpleLongProperty(bedNo);
    }

    public PatientProperty(Long patientId, String patientName, String sex,
                           Long wardNo, Long theBedNo, String deptName,
                           String doctorName, String diagnose,
                           Date createTime) {
        this.patientId = new SimpleLongProperty(patientId);
        this.patientName = new SimpleStringProperty(patientName);
        this.sex = new SimpleStringProperty(sex);
        this.wardNo = new SimpleLongProperty(wardNo);
        this.theBedNo = new SimpleLongProperty(theBedNo);
        this.deptName = new SimpleStringProperty(deptName);
        this.doctorName = new SimpleStringProperty(doctorName);
        this.diagnose = new SimpleStringProperty(diagnose);

        this.createTime = new SimpleStringProperty(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTime.getTime()));
    }

    public PatientProperty(Long patientId, String patientName, String sex,
                           Long wardNo, Long bedNo, Long theBedNo, String deptName,
                           Long doctorId, String doctorName, String illness, String diagnose,
                           Integer status, Date createTime,
                           Date modifyTime, Integer isDelete) {
        this.patientId = new SimpleLongProperty(patientId);
        this.patientName = new SimpleStringProperty(patientName);
        this.sex = new SimpleStringProperty(sex);
        this.wardNo = new SimpleLongProperty(wardNo);
        this.bedNo = new SimpleLongProperty(bedNo);
        this.theBedNo = new SimpleLongProperty(theBedNo);
        this.deptName = new SimpleStringProperty(deptName);
        this.doctorId = new SimpleLongProperty(doctorId);
        this.doctorName = new SimpleStringProperty(doctorName);
        this.illness = new SimpleStringProperty(illness);
        this.diagnose = new SimpleStringProperty(diagnose);

        if (status == 0) {
            this.status = new SimpleStringProperty("住院");
        } else {
            this.status = new SimpleStringProperty("已出院");
        }

        this.createTime = new SimpleStringProperty(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTime.getTime()));
        this.modifyTime = new SimpleStringProperty(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(modifyTime.getTime()));

        this.isDelete = new SimpleIntegerProperty(isDelete);
    }

    public long getPatientId() {
        return patientId.get();
    }

    public void setPatientId(long patientId) {
        this.patientId.set(patientId);
    }

    public SimpleLongProperty patientIdProperty() {
        return patientId;
    }

    public String getPatientName() {
        return patientName.get();
    }

    public void setPatientName(String patientName) {
        this.patientName.set(patientName);
    }

    public SimpleStringProperty patientNameProperty() {
        return patientName;
    }

    public String getSex() {
        return sex.get();
    }

    public void setSex(String sex) {
        this.sex.set(sex);
    }

    public SimpleStringProperty sexProperty() {
        return sex;
    }

    public long getWardNo() {
        return wardNo.get();
    }

    public void setWardNo(long wardNo) {
        this.wardNo.set(wardNo);
    }

    public SimpleLongProperty wardNoProperty() {
        return wardNo;
    }

    public long getBedNo() {
        return bedNo.get();
    }

    public void setBedNo(long bedNo) {
        this.bedNo.set(bedNo);
    }

    public SimpleLongProperty bedNoProperty() {
        return bedNo;
    }

    public long getTheBedNo() {
        return theBedNo.get();
    }

    public void setTheBedNo(long theBedNo) {
        this.theBedNo.set(theBedNo);
    }

    public SimpleLongProperty theBedNoProperty() {
        return theBedNo;
    }

    public long getDoctorId() {
        return doctorId.get();
    }

    public void setDoctorId(long doctorId) {
        this.doctorId.set(doctorId);
    }

    public SimpleLongProperty doctorIdProperty() {
        return doctorId;
    }

    public String getDoctorName() {
        return doctorName.get();
    }

    public void setDoctorName(String doctorName) {
        this.doctorName.set(doctorName);
    }

    public SimpleStringProperty doctorNameProperty() {
        return doctorName;
    }

    public String getIllness() {
        return illness.get();
    }

    public void setIllness(String illness) {
        this.illness.set(illness);
    }

    public SimpleStringProperty illnessProperty() {
        return illness;
    }

    public String getDiagnose() {
        return diagnose.get();
    }

    public void setDiagnose(String diagnose) {
        this.diagnose.set(diagnose);
    }

    public SimpleStringProperty diagnoseProperty() {
        return diagnose;
    }

    public String getStatus() {
        return status.get();
    }

    public void setStatus(String status) {
        this.status.set(status);
    }

    public SimpleStringProperty statusProperty() {
        return status;
    }

    public String getCreateTime() {
        return createTime.get();
    }

    public void setCreateTime(String createTime) {
        this.createTime.set(createTime);
    }

    public SimpleStringProperty createTimeProperty() {
        return createTime;
    }

    public String getModifyTime() {
        return modifyTime.get();
    }

    public void setModifyTime(String modifyTime) {
        this.modifyTime.set(modifyTime);
    }

    public SimpleStringProperty modifyTimeProperty() {
        return modifyTime;
    }

    public int getIsDelete() {
        return isDelete.get();
    }

    public void setIsDelete(int isDelete) {
        this.isDelete.set(isDelete);
    }

    public SimpleIntegerProperty isDeleteProperty() {
        return isDelete;
    }

    public String getDeptName() {
        return deptName.get();
    }

    public void setDeptName(String deptName) {
        this.deptName.set(deptName);
    }

    public SimpleStringProperty deptNameProperty() {
        return deptName;
    }
//    private final SimpleLongProperty patientId;
//    private final SimpleStringProperty patientName;
//    private final SimpleStringProperty sex;
//    private final SimpleLongProperty wardNo;
//    private final SimpleLongProperty bedNo;
//    private final SimpleLongProperty theBedNO;
//    private final SimpleLongProperty doctorId;
//    private final SimpleStringProperty doctorName;
//    private final SimpleStringProperty diagnose;
//    private final SimpleIntegerProperty status;
//    private final SimpleDateFormat createTime;
//    private final SimpleDateFormat modifyTime;
//    private final SimpleIntegerProperty isDelete;
}
